let id = 1;

export const list = (isOk = true, timeout = 1000) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      if (isOk) {
        const list = new Array(10).fill(1).map((item, index) => ({ id: id++, content: Math.random().toString().slice(-10) }));
        resolve(list);
      } else {
        reject();
      }
    }, timeout);
  });
};
